package com.neulogistics.core.customercenter.api.application.converter;

import cn.hutool.json.JSONUtil;

import com.neulogistics.core.customercenter.api.application.query.OrderQuery;
import com.neulogistics.core.customercenter.domain.model.valueobject.Address;
import com.neulogistics.core.customercenter.domain.model.valueobject.OrderItem;
import com.neulogistics.core.customercenter.infrastructure.persistence.orm.po.OrderPO;
import org.springframework.beans.BeanUtils;

public class OrderQueryPOConverter {
    private static final int Rate = 100;
    public static OrderPO queryToPO(OrderQuery orderQuery){

        if(orderQuery == null){
            return null;
        }

        OrderPO orderPO = new OrderPO();

        BeanUtils.copyProperties(orderQuery, orderPO);

        orderPO.setOrderStatus(null);

        if(orderQuery.getOrderType() == -1){
            orderPO.setOrderType(null);
        }

        return orderPO;
    }
}
